﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace DotNet.WebUI.Admin
{
    public partial class ValidateImages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //生成验证码并存入Session
            ProvingCode objProvingCode = new ProvingCode();
            //数字方式
            //Session["DingY.Validate"] = objProvingCode.GetRandomint(5);
            Session["DingY.Validate"] = objProvingCode.CreateRandomCode(5);
            //数字和字母
            //Session["DingY.Validate"] = objProvingCode.CreateStringCode(5);
            //中文
            //Session["DingY.Validate"] = objProvingCode.CreateCNCode();

            //生成图片
            objProvingCode.CreateImage(Session["DingY.Validate"].ToString());
            //objProvingCode.CreateCheckCodeImage(Session["DingY.Validate"].ToString());

        }
    }
}